Skip to content

Conversation

@htibosch
Copy link
Contributor

@htibosch htibosch commented Aug 6, 2025

STM32H legacy driver: change parameter to pucGetRXBuffer()

This issue was reported on the FreeRTOS forum by userhttps://github.com/kzorer.
This is the essential change:

    /* Subtracted 'ipBUFFER_PADDING', which is the size of the meta data. */
    pucBuffer = pucGetRXBuffer( ETH_RX_BUF_SIZE - ipBUFFER_PADDING  );
    configASSERT( pucBuffer != NULL );

This was a result of an earlier patch that repair a vulnerability.

Test Steps

Create an application that connects to the Ethernet and try anything, send it a an ICMP ping message and it will fail. It went wrong in this test:

NetworkBufferDescriptor_t * pxGetNetworkBufferWithDescriptor( size_t xRequestedSizeBytes,
                                                              TickType_t xBlockTimeTicks )
{
    if( ( xNetworkBufferSemaphore != NULL ) &&
        ( xRequestedSizeBytes <= uxMaxNetworkInterfaceAllocatedSizeBytes ) )
    {
    /* xRequestedSizeBytes was too big, it included the buffer meta data.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@htibosch htibosch requested a review from a team as a code owner August 6, 2025 16:08
@moninom1 moninom1 merged commit 68c777b into FreeRTOS:main Aug 7, 2025
10 checks passed
@htibosch htibosch mentioned this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants